package com.huayu.test02.bean;

public class Circle {
    private double r;

    public double getR() {
        return r;
    }

    public void setR(double r) {
        this.r = r;
    }

    public Circle(double r) {
        this.r = r;
    }

    public Circle() {
    }

    //面积
    public void showArea() {
        System.out.println("半径为：" + r + "圆的面积为" + r * r * Math.PI);
    }

    //周长
    public void showPerimeter() {
        System.out.println("半径为：" + r + "圆的周长为" + 2 * Math.PI * r);
    }
}
